User blog:Holomanga/fourier shit
okay so functions are vectors. and when you have vectors, you have basis vectors, which I'm gonna call ei. these are the vectors that you can add together to make any other vector. in 2-D space, they're called (1,0) and (0,1). when you scalar product together two basis vectors, you get ei.ej = δij. that's a fancy way of saying that scalar producting a basis vector by itself gives you 1, and scalar producting a basis vector by a different one gives you 0. (0, 1).(0, 1) = 1. (0, 1).(1,0) = 0. nice. now you can write down a function as a sum of your basis vectors. using bra-ket notation, because I'm a fucking casual, \mid f \rangle = \sum a_i \mid e_i \rangle mhmm that's the stuff. how do we pull out one of those ai coefficients, though? let's try scalar producting by another basis vector on the left and see what happens \langle e_j \mid f \rangle = \sum a_i \langle e_j \mid e_i \rangle but hang on a second! won't that thing on the right be 0 unless i happens to equal j? yeah, it will be, so you gotta set i = j, and lookit that \langle e_j \mid f \rangle = a_j wow I just extracted the coefficient. i'm a fucking badass. bow the fuck down to me. yeah this is gonna be important. okay but what's our basis yeah good question. so our basis is gonna be the complex exponential eikx. wait how do you scalar product functions \langle f \mid g \rangle = \int_{-\pi}^{\pi} f^*(x) g(x) dx you'll notice that this is just the ordinary scalar product of vectors - you're multiplying together each point, and then adding them together. kinda. i dunno. anyway, it works. check it up against the axioms. also these functions are defined on the interval -π to π and assumed to be periodic. just do a change of variables if you wanna do something different. back to "basis" so first we gotta make sure that our basis vectors make an orthonormal basis, which means that they do that fancy 0/1 shit i showed up there. let's vector product together two different basis vectors and see what happens. \langle e_k \mid e_\ell \rangle = \int_{-\pi}^{\pi} e^{-ikx} e^{i\ell x} dx = 0 okay wew that's good. how about if we do it with the same vector \langle e_k \mid e_k \rangle = \int_{-\pi}^{\pi} e^{-ikx} e^{ikx} dx = 2\pi fuck that's not good, that should be a 1. let's just divide everything by root 2pi and pretend this never happened. \mid e_k \rangle = \frac{1}{\sqrt {2\pi}} e^{-ikx} yeah that's good. so okay let's just express functions in terms of this and we'll be sorted complex fourier series \mid f \rangle = \sum_{k=0}^\infty \langle e_k \mid f \rangle \mid e_k \rangle so : f(x) = \frac{1}{\sqrt{2 \pi}} \sum_{k=-\infty}^\infty c_k e^{ikx} : c_k = \frac{1}{\sqrt{2 \pi}} \int_{-\pi}^\pi e^{-ikx} f(x) dx yeah that's good. that's the good shit. but wouldn't it be better if we could do it without complex numbers i'm tired i don't want to deal with them. simple fourier series so after a lot of bullshit algebra to change all those e's into sins and cosses (hint: e-k = e-ikx, so you can construct the trigonometric functions from it)(and also setting the zeroth basis vector e0 to \frac{1}{\sqrt{2\pi}} ), you get : f(x) = \frac{a_0}{2} + \sum_{k=0}^\infty \left( a_k \cos n \pi + b_k \sin n \pi \right) : a_k = \frac{1}{\pi} \int_{-\infty}^\infty \cos x f(x) dx : b_k = \frac{1}{\pi} \int_{-\infty}^\infty \sin x f(x) dx this is the fourier sine and cosine series. respect it. fourier transform so you might have noticed that you can find the coefficient ck for any value of k, not just non-integer ones. these have less direct meaning, maybe, but are still v.v.v.v.v.v.v.v.v. important. It makes a function in k, called the Fourier transform of f(x). This is what people mean when they say Fourier transform. It goes like this: \hat{f}(k) = \frac{1}{\sqrt{2 \pi}} \int_{-\infty}^\infty e^{-ikx} f(x) dx we switched to infinity because it turns out that if you change the variable and the limits at the same time it cancels out in this one specific case , we're rolling with it, fuckkk so that's the Fourier transform. it gives like the sum of frequencies that make up a single function. pretty neat. you can find like harmonics and stuff if you have a wave. also there are a couple of theorems yeah fourier shit Category:Blog posts